/// @tags: SG
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

namespace BlueQuantum {

int const N = 50 + 1, A = 1e3 + 1;

int n;
int a[N], f[N][N * A];

/// @param o 一的个数 @param s 除一外的堆石子数之和减堆数减一
bool dfs(int o_cnt, int s) {
  if (f[o_cnt][s] != -1) return f[o_cnt][s];
  if (o_cnt == 0 && s == 0) return (f[o_cnt][s] = false);
  if (o_cnt && !dfs(o_cnt - 1, s)) return (f[o_cnt][s] = true);
  if (o_cnt >= 2 && !dfs(o_cnt - 2, s + 2 + bool(s))) return (f[o_cnt][s] = true);
  if (o_cnt && s && !dfs(o_cnt - 1, s + 1)) return (f[o_cnt][s] = true);
  if (s > 2 && !dfs(o_cnt, s - 1)) return (f[o_cnt][s] = true);
  if (s == 2 && !dfs(o_cnt + 1, 0)) return (f[o_cnt][s] = true);
  return (f[o_cnt][s] = false);
}

inline bool calc() {
  int sum = n;
  for (int i = 1; i <= n; ++i) sum += a[i];
  sort(a + 1, a + n + 1);
  int cnt = n;
  while (cnt && a[cnt] != 1) --cnt;
  return dfs(cnt, sum - cnt - cnt - 1);
}

inline int main() {
  int t;
  cin >> t;
  memset(f, -1, sizeof(f));
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    cout << (calc() ? "YES" : "NO") << '\n';
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("石子游戏问题.in", "r", stdin);
  freopen("石子游戏问题.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
